package com.lswms.modules.lswms.dao.orders;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.lswms.common.dao.BaseDao;
import com.lswms.modules.lswms.entity.orders.OrdersEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 出库
 *
 * @author DX sunlightcs@gmail.com
 * @since 1.0.0 2021-06-24
 */
@Mapper
public interface OrdersDao extends BaseDao<OrdersEntity> {
	@Select(value ="select lswms_orders.*, b.listname typestr , c.listname  statusstr    from lswms_orders  left join lswms_codelist b on lswms_orders.type = b.list and b.code='orderType' "
			+ "	left join lswms_codelist c on lswms_orders.status = c.list and c.code='OrderStatus'  ${ew.customSqlSegment}")
	IPage<OrdersEntity> selectPageBySql(IPage<OrdersEntity> page, @Param(Constants.WRAPPER) QueryWrapper<OrdersEntity> wrapper);
	
}